window.vueLocalstroge = {
	date:'',
	setItem:function(key,value){
		typeof value ==='object' ? value=JSON.stringify(value):value;
		var myDate = new Date();
		var time = myDate.getFullYear()+ myDate.getDate() + myDate.getMonth() + 1;
		window.localStorage.setItem(key+'_time',time)
		window.localStorage.setItem(key,value)
	},
	getItem:function(key){
		var data ;
		this.checkTime(key);
		try
		{
		   data = JSON.parse(window.localStorage.getItem(key))//在此运行代码
		}
		catch(err)
		{
		   data= window.localStorage.getItem(key) //在此处理错误
		}
		return data
	},
	removeItem:function(key){
		window.localStorage.removeItem(key);
	},
	checkTime:function(key){
		var myDate = new Date();
		var time = myDate.getFullYear()+ myDate.getDate() + myDate.getMonth();
		console.log(time)
		var expiry = window.localStorage.getItem(key+'_time')-0;
		console.log(time)
		if(expiry-time>=0){
			return true
		}else{
			this.removeItem(key);
			return false
		}
	}

}